/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pruebaVisitor;

/**
 *
 * @author Instructor
 */
class DiscountVisitor implements Visitor{

    private double totalDiscount = 0;

    public void visit(Libro libro) {
        totalDiscount += libro.getPrice()*.1;
    }

    public void visit(CD cd) {
        totalDiscount += cd.getPrice()*.25;
    }

    public void visit(PSGame game) {
        totalDiscount += game.getPrice()*.15;
    }

    /**
     * @return the totalDiscount
     */
    public double getTotalDiscount() {
        return totalDiscount;
    }


}
